// 报销接口
export interface Expense {
  id: number
  admin_id: number
  did: number
  expense_time: string
  income_month: string
  amount: number
  cate_id: number
  remarks: string
  check_status: number
  check_uids: string
  check_time: number
  pay_status: number
  pay_admin_id: number
  pay_time: number
  file_ids: string
  create_time: number
  update_time: number
  delete_time: number
  // 扩展字段
  check_status_str?: string
  admin_name?: string
  department?: string
  check_user?: string
  pay_name?: string
}

// 发票接口
export interface Invoice {
  id: number
  admin_id: number
  did: number
  contract_id: number
  project_id: number
  customer_id: number
  name: string
  code: string
  amount: number
  tax_amount: number
  no_tax_amount: number
  check_status: number
  check_uids: string
  check_time: number
  open_status: number
  open_admin_id: number
  open_time: number
  enter_time: number
  delivery: number
  file_ids: string
  other_file_ids: string
  create_time: number
  update_time: number
  delete_time: number
  // 扩展字段
  check_status_str?: string
  admin_name?: string
  department?: string
  contract_name?: string
  open_name?: string
  remarks?: string
}

// 收票接口
export interface Ticket {
  id: number
  admin_id: number
  did: number
  supplier_id: number
  purchase_id: number
  project_id: number
  name: string
  code: string
  amount: number
  tax_amount: number
  no_tax_amount: number
  check_status: number
  check_uids: string
  check_time: number
  open_status: number
  open_time: number
  pay_status: number
  pay_time: number
  file_ids: string
  other_file_ids: string
  create_time: number
  update_time: number
  delete_time: number
  // 扩展字段
  check_status_str?: string
  admin_name?: string
  department?: string
  supplier_name?: string
  open_time_str?: string
  pay_time_str?: string
  ticket_status?: number
  remarks?: string
}

// 费用分类接口
export interface ExpenseCate {
  id: number
  title: string
  status: number
  create_time: number
}

// 成本分类接口
export interface CostCate {
  id: number
  title: string
  status: number
  create_time: number
}

// API响应类型
export interface ApiResponse<T> {
  code: number
  msg: string
  data: T
  count?: number
}

// 财务状态接口
export interface FinanceState {
  expenses: Expense[]
  expenseTotal: number
  invoices: Invoice[]
  invoiceTotal: number
  tickets: Ticket[]
  ticketTotal: number
  expenseCates: ExpenseCate[]
  costCates: CostCate[]
}

// 报销列表参数接口
export interface ExpenseListParams {
  page: number
  limit: number
  keywords?: string
  check_status?: string
  pay_status?: string
  admin_id?: number | string
}

// 金额范围类型
export interface AmountRange {
  min: number | ''
  max: number | ''
}

// 管理员选项类型
export interface AdminOption {
  id: number
  name: string
}

// 搜索表单类型
export interface SearchForm {
  keywords?: string
  check_status?: string
  pay_status?: string
  admin_id?: number | string
  expenseTimeRange?: [string, string]
  payTimeRange?: [string, string]
  amountRange?: AmountRange
}

// 高级搜索表单类型
export interface AdvancedSearchForm {
  keywords?: string
  check_status?: string
  pay_status?: string
  admin_id?: number | string
  expenseTimeRange?: [string, string]
  payTimeRange?: [string, string]
  amountRange?: AmountRange
  department_id?: number | string
  project_id?: number | string
}

// 查询表单类型（用于发票和收票）
export interface QueryForm {
  keywords?: string
  check_status?: string
  dateRange?: [string, string]
  admin_id?: number | string
  contract_id?: number | string
  project_id?: number | string
  customer_id?: number | string
  supplier_id?: number | string
}

// ExpenseItem 作为 Expense 的别名
export type ExpenseItem = Expense
